Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 62f73be4bd4e0cb8892a3f82458675558e1067c7


Parents : 1042bce
Author : Mark Qvist <bc7291552be7a58f361522990465165c>
Signature : T66BB85Valid, signed by author
Date : 2026-07-26T03:52:45+02:00

Pause/resume AGC in HDX calls on PTT

Changes

2 files changed, 16 insertions(+), 1 deletions(-)


Diff

diff --git a/LXST/Filters.py b/LXST/Filters.py
index 80b7453..3fc3263 100644
--- a/LXST/Filters.py
+++ b/LXST/Filters.py
@@ -186,6 +186,7 @@ class AGC(Filter):
self.hold_time = hold_time
self.target_linear = 10 ** (target_level / 10)
self.max_gain_linear = 10 ** (max_gain / 10)
+ self.paused = False
self._samplerate = None
self._channels = None
self._current_gain_lin = 1.0
@@ -198,6 +199,7 @@ class AGC(Filter):
def handle_frame(self, frame, samplerate):
# TODO: Remove debug
# st = time.time()
+ if self.paused: return frame
if len(frame) == 0: return frame
if len(frame.shape) == 1: frame_2d = frame.reshape(-1, 1)
else: frame_2d = frame

diff --git a/LXST/Primitives/Telephony.py b/LXST/Primitives/Telephony.py
index 903c32c..d66aa67 100644
--- a/LXST/Primitives/Telephony.py
+++ b/LXST/Primitives/Telephony.py
@@ -558,12 +558,24 @@ class Telephone(SignallingReceiver):
self.__loudspeaker_on = not disable
if was_on != self.__loudspeaker_on: self.__update_audio_output()
+ def pause_agc(self, pause=True):
+ if self.active_call and hasattr(self.active_call, "filter_agc"):
+ if pause: self.active_call.filter_agc.paused = True
+ else: self.active_call.filter_agc.paused = False
+
+ def resume_agc(self, resume=True):
+ if self.active_call and hasattr(self.active_call, "filter_agc"):
+ if resume: self.active_call.filter_agc.paused = False
+ else: self.active_call.filter_agc.paused = True
+
def squelch_transmit(self, squelch=True):
+ self.pause_agc(squelch)
if self.active_call and hasattr(self.active_call, "packetizer"):
if squelch: self.active_call.packetizer.squelch()
else: self.active_call.packetizer.unsquelch()
def unsquelch_transmit(self, unsquelch=True):
+ self.resume_agc(unsquelch)
if self.active_call and hasattr(self.active_call, "packetizer"):
if unsquelch: self.active_call.packetizer.unsquelch()
else: self.active_call.packetizer.squelch()
@@ -755,7 +767,8 @@ class Telephone(SignallingReceiver):
filter_chain = []
if self.use_bandpass: filter_chain.append(BandPass(250, 8500))
- if self.use_agc: filter_chain.append(AGC(target_level=-15.0))
+ if self.use_agc: self.active_call.filter_agc = AGC(target_level=-15.0)
+ if self.use_agc: filter_chain.append(self.active_call.filter_agc)
if self.use_echo_cancellation:
self.active_call.echo_suppressor = EchoSuppressor()
self.receive_mixer.reference_outs = [self.active_call.echo_suppressor]


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────